<?php
defined('ROOTPATH') OR exit('Forbidden');

class con_main {

    public function index() {
        echo '控制器载入成功！<br>';
        mod_main::main();
        session::set('user', 'kangyuan');
        echo 'session为：'.session::get('user').'<br>';
        view::assign('msg', '视图显示成功信息！');
        view::display('main/index');
        $test_input_get = input::get('input_get');
        echo '输入为：'.$test_input_get;
    }

    public function api() {
        $data = array(
            'name' => 'mrckphp',
            'author' => 'kangyuan',
            'version' => 'v0.1',
        );
        output::api(0, 'web framework info', $data);
    }

    public function dbtest() {
        $result = mod_main::getDbTest();
        echo "<pre>";
        print_r($result);
    }
}
